// i.r(t), i.d(t, { default: () => ScanInfoDataModule })
import Module from "./Module"
class ScanData {
  scansById: {}
  scansByAnchor: {}
}

import { NotImplementedError } from "../exception/store.exception"
class EmptyScanInfoStore {
  async create() {
    throw new NotImplementedError()
  }
  async update() {
    throw new NotImplementedError()
  }
  async delete() {
    throw new NotImplementedError()
  }
  async read() {
    const e = new ScanData()
    return (e.scansById = {}), (e.scansByAnchor = {}), Promise.resolve(e)
  }
  async refresh() {
    return this.read()
  }
}
export default class ScanInfoDataModule extends Module {
  getScanInfo: (e: any) => any
  store: any
  getScanDownloadURL: (e: any) => any
  constructor() {
    super(...arguments),
      (this.name = "scaninfo-data"),
      (this.getScanInfo = e => this.store.read().then(t => (t ? t.scansByAnchor[e] : void 0))),
      (this.getScanDownloadURL = e =>
        this.store.refresh().then(t => {
          if (t) {
            const i = t.scansByAnchor[e]
            return i ? i.url : void 0
          }
        }))
  }
  async init(e) {
    this.store = this.getStore(e)
  }
  getStore(e) {
    return new EmptyScanInfoStore()
  }
}
